/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bitoon.basketdudes.jpa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.SequenceGenerator;
import javax.persistence.GenerationType;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
/**
 *
 * @author paco
 */
@Entity
@Table(name = "marca_user", schema = "central" )
@NamedQueries({
    @NamedQuery(name = "MarcaUser.findAll", query = "SELECT m FROM MarcaUser m"),
    @NamedQuery(name = "MarcaUser.findById", query = "SELECT m FROM MarcaUser m WHERE m.id = :id"),
    @NamedQuery(name = "MarcaUser.findByNick", query = "SELECT m FROM MarcaUser m WHERE m.nick = :nick")
})
public class MarcaUser implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name="marca_user_id_generator", sequenceName="central.marca_user_id_seq" )
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="marca_user_id_generator")

    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;

    @ManyToOne
    @JoinColumn(name="usuario_id", referencedColumnName = "id")
    private Usuario usuario;

    @Basic(optional = false)
    @Column(name = "nick")
    private String nick;

    @Basic(optional = true)
    @Column(name = "email")
    private String email;

    @Basic(optional = true)
    @Column(name = "marca_id")
    private Integer marcaId;

    @Basic(optional = true)
    @Column(name = "password")
    private String password;



    public MarcaUser() {
    }

    public MarcaUser(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario valor) {
        this.usuario = valor;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String valor) {
        this.email = valor;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String valor) {
        this.nick = valor;
    }


    public Integer getMarcaId() {
        return marcaId;
    }

    public void setMarcaId(Integer id) {
        this.marcaId = id;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String valor) {
        this.password = valor;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Movimiento)) {
            return false;
        }
        MarcaUser other = (MarcaUser) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bitoon.basketdudes.jpa.MarcaUser[id=" + id + "]";
    }

}
